<?php 
include '../data/data.php';
$conn = new mysqli($config['ip'], $config['user'], $config['pass'], $config['data']);
$link=mysql_connect($config['ip'],$config['user'],$config['pass']); 
$a=mysql_select_db($config['data'], $link) or die("Unable to connect to the MySQL!");
$user=$_SESSION['user']; //获取到的用户名
$pass=$_SESSION['pass']; //获取到的密码
$gid=intval($_GET['game_id']);
$result= mysql_query("SELECT * FROM games WHERE id='$gid'", $link);  
$row = mysql_fetch_array($result);
if($row[type]=='MV'){
      $cbx='满V版';
      }elseif($row[type]=='BT'){
      $cbx='超变版';
      }elseif($row[type]=='GM'){
      $cbx='GM版';
      }elseif($row[type]=='H5'){
      $cbx='H5版';
}
if($row[api]!='0'){
}else{
	exit(header('location:/index.html'));
}
$resultx= mysql_query("SELECT * FROM user WHERE username='$user' and password='$pass'", $link);  
$rowx = mysql_fetch_array($resultx);
if($rowx[id]==''){
	header('location:/user/login.html?fwd=/game/gback.html?game_id='.$gid);
}
//---------授权数据
$_SESSION['gameid']=$gid;  //游戏编号
if($rowx[gm]=='5'){
$_SESSION['money']='0';
}else{
$_SESSION['money']=$row[money];
}
?>
<html lang="en"><head>
  <meta charset="UTF-8">
<title><?php echo $row[name]; ?> - GM工具</title>
<meta name="viewport" content="width=device-width, initial-scale=1, user-scalable=no">
<link rel="shortcut icon" href="/images/favicon.ico" type="image/x-icon">
<meta name="description" content="">
<meta name="viewport" content="width=device-width,initial-scale=1,maximum-scale=1,user-scalable=no">
<meta name="apple-mobile-web-app-capable" content="yes">
<style>
    .userline{float:left;width:100%;height:30px;background-color:#ffffff;line-height:30px;}
    .userline_1{float:left;width:30%;height:2.2em;background-color:#8E236B;color:#fff;text-align:center;}
    .userline_2{float:left;width:60%;height:30px;text-align:center;}
    .userline_2 input{width:90%;font-size:14px;}
    .userline_info{float:left;width:100%;height:25px;line-height:20px;text-align:center;}

</style></head>
  <link rel="stylesheet" href="/public/styles/base.css"/>
<link rel="stylesheet" href="/styles/game_info.css"/>
    <link rel="stylesheet" href="/css/new.css"/>
    <link rel="stylesheet" href="/styles/ranking.css"/>
    <link rel="stylesheet" href="/layer/mobile/need/layer.css"/>
    <link rel="stylesheet" href="/assets/css/main.css?v=7">

<body>
<div class="wrapper">
    <div class="userline"><div class="userline_1"><?php echo $row[biaoqian]; ?></div>
    <div class="userline_2"><input type="text" name="uid" id="uid" placeholder="请输入【<?php echo $row[biaoqian]; ?>】"></div></div>
    <div class="userline_info"></div>
	    <div class="userline"><div class="userline_1">开通费用</div><div class="userline_2" style="color:#8E236B"><?php if($rowx[gm]=='5'){echo '包站会员';}elseif($rowx[gm]=='0'){echo $row[money];}else{header('location:/user/login.html?fwd=/game/gback.html?game_id='.$gid);} ?></div></div>
         <input type="submit" name="button" id="sub" value="立即开通" style="width:100%; margin-top: 14px; font-size: 16px">  
    <div height="700px" width="100%">
<iframe height="500px" width="100%" src="<?php echo $row[gm]; ?>?sdk=<?php echo base64_encode($rowx[username].';'.$row[id]); ?>">
        </iframe>
    </div>
    
<footer id="footer" class="z_footer" style="">
    <nav>
        <a target="_top" href="/index.html" style="margin-left: 2%;">
            <p class="img_1"><img src="/picture/home.png" alt=""></p>
            <p class="img_2"><img src="/picture/home1.png" alt=""></p>
            <span>首页</span>
        </a>
        <a target="_top" href="/game/type.html?tc=GM" >
            <p class="img_1"><img src="/picture/game.png" alt=""></p>
            <p class="img_2"><img src="/picture/game1.png" alt=""></p>
            <span>GM</span>
        </a>
        <a target="_top" href="/game/game.html?tc=rm" title=""  id="footer_nav_active">
            <p class="img_1"><img src="/picture/game.png" alt=""></p>
            <p class="img_2"><img src="/picture/game1.png" alt=""></p>
            <span>BT</span>
        </a>
        <a target="_top" href="/user/user.html" title="">
            <p class="img_1"><img src="/picture/user.png" alt=""></p>
            <p class="img_2"><img src="/picture/user1.png" alt=""></p>
            <span>我的</span>
        </a>
    </nav>
</footer>

</div>
  <script src="/public/scripts/jquery-1.11.1.min.js"></script>
<script src="/public/scripts/jquery.qrcode.min.js"></script>
<script> var gid='<?php echo $gid; ?>';</script>
  <script src="/game/kt.js"></script>
</body></html>